//
//  LableCell.m
//  UI13-段子
//
//  Created by dllo on 16/6/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LableCell.h"
#import "GetHightTools.h"

@interface LableCell ()
@property (nonatomic,retain)UILabel *lable;

@end

@implementation LableCell
-(void)dealloc{
    [_lable release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.lable = [[UILabel alloc]init];
        [self.contentView addSubview:self.lable];
        [_lable release];
        self.lable.numberOfLines = 0;
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    CGFloat height = [GetHightTools getHeight:self.model.digest width:414 font:self.lable.font];
    self.lable.frame = CGRectMake(0, 0, 414, height);
    self.lable.backgroundColor = [UIColor orangeColor];
}

- (void)setModel:(Model *)model{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.lable.text = model.digest;
}





































@end
